package com.yuanwushe.blue.function;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by blue on 2018/5/30.
 */

public class ActivityController {

    public static List<Activity> mActivitys = new ArrayList<>();

    public static void addActivity(Activity activity) {
        mActivitys.add(activity);
    }

    public static void removeActivity(Activity activity) {
        mActivitys.remove(activity);
    }

    public static void finishAll() {
        for (Activity activity : mActivitys) {
            if (!activity.isFinishing()) {
                activity.finish();
            }
        }
    }
}
